let nums = [2, 2, 1, 3, 1]
var singleNumber = function (nums) {
    let result = 0
    for (let i = 0; i < nums.length; i++) {
        result ^= nums[i]
    }
    return result
};
console.log(singleNumber(nums));
